import requests from '@/utils/http.js'
// 'Content-Type':'application/json' 可以用@ReuqestBody 接收
// 'Content-Type':'application/json', 发送格式 key1=value1&key2=value2
// 这里是菜单管理 

// axios 发送登录请求
export const login = (formdata) =>{
    return requests({
        method:'post',
        url:'/login',
        data:formdata,
    })
}

export const get = (formdata)=>{
    return requests({
        method:'post',
        url:'',
        data:formdata,
        handers :{
            'Content-Type':'application/json',
        }
    })
}
export const enroll = (formdata) =>{
    return requests({
        method:'post',
        url:'/enroll',
        data:formdata
    })
}
export const setAccount = (formdata) =>{
    return requests({
        method:'post',
        url:'/setAccount',
        data:formdata
    })
}
export const getFormData = () =>{
    return requests({
        method:'post',
        url:'/Dish/getFormData',
    })
}
// 菜单管理中的查询
export const getMenuData = (formdata) =>{
    return requests({
        method:'get',
        url:'/Dish/getMenuData',
        params:formdata
    })
}
//  这里是订单明细
export const order_getTableData = (data) =>{
    return requests({
        method:'get',
        url:'/orders/getTableData',
        params:data
    })
}
// 新增dish
export const addDish = (formdata) =>{
    return requests({
        method:'post',
        url:'/Dish/addDish',
        data:formdata
    })
}
// 更新Dish的内容
export const updateDish = (formdata) =>{
    return requests({
        method:'put',
        url:'/Dish',
        data:formdata
    })
}
// 删除整行数据
export const deleteDish = (formdata)=>{
    return requests({
        method:'post',
        url:'/Dish/deleteDish',
        data:formdata
    })
}
// 设置起售
export const setSail = (formdata)=>{
    return requests({
        method:'post',
        url:'/Dish/sailDish',
        data:formdata
    })
}
// 设置停售
export const setStop = (formdata) =>{
    return requests({
        method:'post',
        url:'/Dish/stopDish',
        data:formdata
    })
}

// 获取用户名称
export const getUserName = () =>{
    return requests({
        method:'post',
        url:'/Employee/getUserName'
    })
}
// 更新员工信息
export const updateEmployee = (formdata) =>{
    return requests({
        method:'post',
        url:'/Employee/updateEmployee',
        data:formdata
    })
}

// 订单查询
export const order_Search = (formdata) =>{
    return requests({
        method:'get',
        url:'/orders/search',
        params:formdata
    })
}
// 员工管理页面
export const employee_getTableData = (formdata) =>{
    return requests({
        method:'get',
        url:'/Employee',
        params:formdata
    })
}
// 删除员工
export const deleteById=(formdata) =>{
    return requests({
        method:'get',
        url:'/Employee/deleteById',
        params:formdata
    })
}
// 分类获取全部数据
export const category_getTableData = (data) =>{
    return requests({
        method:'get',
        url:'/category',
        params:data
    })
}
// 分类查询
export const category_search = (formdata) =>{
    return requests({
        method:'get',
        url:'/category/search',
        params:formdata
    })
}
// 分类删除
export const category_deleteById=(formdata) =>{
    return requests({
        method:'get',
        url:'/category/deleteById',
        params:formdata
    })
}
// 更新菜类信息
export const updateCategory = (formdata) =>{
    return requests({
        method:'post',
        url:'/category/updateCategory',
        data:formdata
    })
}

export const login1 = (formdata) =>{
    return requests({
        method:'post',
        url:'/usercase/login1',
        data:formdata
    })
}

export const getCategoryData = () =>{
    return requests({
        methods:'get',
        url:'/category/getAllData',
    })
}

// 上传图片
export const upload = (formdata) =>{
    return requests({
        methods:'post',
        url:"/marketer/upload",
        data:formdata
    })
}